package chapter04.demo02;

/**
 * 1.super关键字
 * 2.final关键字
 */
class Teacher{
    public void code(){
        System.out.println("上课了收手机");
        System.out.println("疯狂写代码");
    }
    final void speak(){
        System.out.println("吹牛");
    }
}
class ProgrammerTeacher extends Teacher{
    public void code(){
        System.out.println("小朋友不写代码");
    }
}
class HighTeacher extends Teacher{//李狗嗨
    public void code(){
        //super调用父类方法
        super.code();
        System.out.println("疯狂的推电视剧和动漫");
    }
    //父类 spea方法是final最终的 无法修改重写
//    final void speak(){
//
//    }
}
public class demo02 {
    public static void main(String[] args) {
        ProgrammerTeacher pt = new ProgrammerTeacher();
        pt.code();
        HighTeacher ht = new HighTeacher();
        ht.code();

        pt.speak();
        ht.speak();
    }
}
